

#include <sys/cdefs.h>


#if defined(_KERNEL) || defined(_STANDALONE)
#include <lib/libkern/libkern.h>
#if defined(_STANDALONE)
#include <lib/libsa/stand.h>
#endif
#else
#include <assert.h>
#include <string.h>
#endif

/*
 * bcmp -- vax cmpc3 instruction
 */
int
bcmp(const void *b1, const void *b2, size_t length)
{
	const char *p1 = b1, *p2 = b2;

	_DIAGASSERT(b1 != 0);
	_DIAGASSERT(b2 != 0);

	if (length == 0)
		return(0);
	do
		if (*p1++ != *p2++)
			break;
	while (--length);
	return length != 0;
}
